/**
 * CommentItem 组件文档配置
 * 包含 props 和 emits 的详细说明
 */

export interface PropDocumentation {
  name: string
  type: string
  default?: string
  required: boolean
  description: string
  options?: string[]
}

export interface EmitDocumentation {
  name: string
  parameters: Array<{
    name: string
    type: string
    description: string
  }>
  description: string
}

export const commentItemProps: PropDocumentation[] = [
  {
    name: 'comment',
    type: 'Comment',
    required: true,
    description: '评论数据对象，包含评论的所有信息',
  },
  {
    name: 'replies',
    type: 'Comment[]',
    default: '[]',
    required: false,
    description: '回复列表，包含该评论的所有回复',
  },
  {
    name: 'showReplies',
    type: 'boolean',
    default: 'false',
    required: false,
    description: '是否显示回复列表',
  },
  {
    name: 'hasMoreReplies',
    type: 'boolean',
    default: 'false',
    required: false,
    description: '是否还有更多回复未加载',
  },
  {
    name: 'submitting',
    type: 'boolean',
    default: 'false',
    required: false,
    description: '是否正在提交回复',
  },
  {
    name: 'layout',
    type: 'CommentLayout',
    default: "'default'",
    required: false,
    description: '布局样式',
    options: ['default', 'compact', 'minimal', 'card', 'timeline'],
  },
  {
    name: 'responsive',
    type: 'boolean',
    default: 'true',
    required: false,
    description: '是否启用响应式布局',
  },
  {
    name: 'showAvatar',
    type: 'boolean',
    default: 'true',
    required: false,
    description: '是否显示头像',
  },
  {
    name: 'showActions',
    type: 'boolean',
    default: 'true',
    required: false,
    description: '是否显示操作按钮',
  },
  {
    name: 'showReplyButton',
    type: 'boolean',
    default: 'true',
    required: false,
    description: '是否显示回复按钮',
  },
  {
    name: 'showLikeButton',
    type: 'boolean',
    default: 'true',
    required: false,
    description: '是否显示点赞按钮',
  },
  {
    name: 'showMoreButton',
    type: 'boolean',
    default: 'true',
    required: false,
    description: '是否显示更多操作按钮',
  },
  {
    name: 'showTimestamp',
    type: 'boolean',
    default: 'true',
    required: false,
    description: '是否显示时间戳',
  },
  {
    name: 'showReplyCount',
    type: 'boolean',
    default: 'true',
    required: false,
    description: '是否显示回复数量',
  },
  {
    name: 'showRepliesSection',
    type: 'boolean',
    default: 'true',
    required: false,
    description: '是否显示回复区域',
  },
  {
    name: 'avatarSize',
    type: 'AvatarSize',
    default: "'md'",
    required: false,
    description: '头像尺寸',
    options: ['xs', 'sm', 'md', 'lg', 'xl', '2xl'],
  },
  {
    name: 'cardStyle',
    type: 'CardStyle',
    default: "'default'",
    required: false,
    description: '卡片样式',
    options: ['default', 'minimal', 'elevated', 'outlined', 'flat', 'glass', 'neon'],
  },
  {
    name: 'spacing',
    type: 'Spacing',
    default: "'normal'",
    required: false,
    description: '间距大小',
    options: ['tight', 'normal', 'loose', 'xl'],
  },
  {
    name: 'styleConfig',
    type: 'StyleConfig',
    required: false,
    description: '样式配置对象，包含自定义类名、CSS变量等',
  },
  {
    name: 'themeConfig',
    type: 'ThemeConfig',
    required: false,
    description: '主题配置对象，支持多种主题类型',
  },
  {
    name: 'responsiveConfig',
    type: 'ResponsiveConfig',
    required: false,
    description: '响应式配置对象，支持不同屏幕尺寸的配置',
  },
  {
    name: 'animationConfig',
    type: 'AnimationConfig',
    required: false,
    description: '动画配置对象，控制动画类型、持续时间等',
  },
  {
    name: 'enableHover',
    type: 'boolean',
    default: 'true',
    required: false,
    description: '是否启用悬停效果',
  },
  {
    name: 'enableAnimations',
    type: 'boolean',
    default: 'true',
    required: false,
    description: '是否启用动画效果',
  },
  {
    name: 'enableClickOutside',
    type: 'boolean',
    default: 'true',
    required: false,
    description: '是否启用点击外部关闭功能',
  },
  {
    name: 'enableKeyboard',
    type: 'boolean',
    default: 'true',
    required: false,
    description: '是否启用键盘导航',
  },
  {
    name: 'customClass',
    type: 'string',
    required: false,
    description: '自定义CSS类名',
  },
  {
    name: 'customStyle',
    type: 'Record<string, string>',
    required: false,
    description: '自定义内联样式',
  },
  {
    name: 'customVars',
    type: 'Record<string, string>',
    required: false,
    description: '自定义CSS变量',
  },
  {
    name: 'customFormatTime',
    type: '(dateString: string) => string',
    required: false,
    description: '自定义时间格式化函数',
  },
]

export const commentItemEmits: EmitDocumentation[] = [
  {
    name: 'toggleReplies',
    parameters: [
      {
        name: 'commentId',
        type: 'string',
        description: '评论ID',
      },
    ],
    description: '切换回复列表显示状态',
  },
  {
    name: 'loadMoreReplies',
    parameters: [
      {
        name: 'parentId',
        type: 'string',
        description: '父评论ID',
      },
    ],
    description: '加载更多回复',
  },
  {
    name: 'toggleLike',
    parameters: [
      {
        name: 'commentId',
        type: 'string',
        description: '评论ID',
      },
    ],
    description: '切换点赞状态',
  },
  {
    name: 'createReply',
    parameters: [
      {
        name: 'parentId',
        type: 'string',
        description: '父评论ID',
      },
      {
        name: 'content',
        type: 'string',
        description: '回复内容',
      },
      {
        name: 'mentionedUsers',
        type: 'string[]',
        description: '提及的用户ID列表',
      },
    ],
    description: '创建新回复',
  },
  {
    name: 'reportComment',
    parameters: [
      {
        name: 'commentId',
        type: 'string',
        description: '评论ID',
      },
    ],
    description: '举报评论',
  },
  {
    name: 'deleteComment',
    parameters: [
      {
        name: 'commentId',
        type: 'string',
        description: '评论ID',
      },
    ],
    description: '删除评论',
  },
  {
    name: 'avatarClick',
    parameters: [
      {
        name: 'author',
        type: 'Comment["author"]',
        description: '作者信息对象',
      },
    ],
    description: '点击头像事件',
  },
  {
    name: 'authorClick',
    parameters: [
      {
        name: 'author',
        type: 'Comment["author"]',
        description: '作者信息对象',
      },
    ],
    description: '点击作者名事件',
  },
  {
    name: 'contentClick',
    parameters: [
      {
        name: 'comment',
        type: 'Comment',
        description: '评论对象',
      },
    ],
    description: '点击评论内容事件',
  },
  {
    name: 'replyClick',
    parameters: [
      {
        name: 'reply',
        type: 'Comment',
        description: '回复对象',
      },
    ],
    description: '点击回复事件',
  },
  {
    name: 'avatarClick',
    parameters: [
      {
        name: 'author',
        type: 'Comment["author"]',
        description: '作者信息对象',
      },
    ],
    description: '点击头像事件',
  },
  {
    name: 'authorClick',
    parameters: [
      {
        name: 'author',
        type: 'Comment["author"]',
        description: '作者信息对象',
      },
    ],
    description: '点击作者名事件',
  },
  {
    name: 'contentClick',
    parameters: [
      {
        name: 'comment',
        type: 'Comment',
        description: '评论对象',
      },
    ],
    description: '点击评论内容事件',
  },
]
